package com.Ajava1801D.设计模式.代理模式.动态代理.JDK代理;

import java.lang.reflect.Proxy;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2020/10/12  14:11
 * 描述:
 */
public class TestJDK {

    public static void main(String[] args) {
       /* Test1801InterfaceImpl test1801Interface=new Test1801InterfaceImpl();

        My1801InvocationHandler my1801InvocationHandler=new My1801InvocationHandler(test1801Interface);

        //Class<?>[] classes = Test1801InterfaceImpl.class.getInterfaces();

        Class<?>[] classes={Test1801Interface.class};

        Test1801Interface o = (Test1801Interface)Proxy.newProxyInstance(Test1801Interface.class.getClassLoader(), classes, my1801InvocationHandler);

        System.out.println(o.test());*/

        My1801InvocationHandler02 my1801InvocationHandler02=new My1801InvocationHandler02();

        Class<?>[] classes={Test1801Interface02.class};

        Test1801Interface02 uuu=(Test1801Interface02)Proxy.newProxyInstance(Test1801Interface02.class.getClassLoader(),classes,my1801InvocationHandler02);



        System.out.println(uuu.test("55555"));

    }

}
